# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>

pkgname=fping
pkgver=5.1
pkgrel=2
pkgdesc='Utility to ping multiple hosts at once'
url='https://www.fping.org/'
arch=('x86_64')
license=('custom')
depends=('glibc')
install=${pkgname}.install
validpgpkeys=('8D1E89B8FBA920A5A609F2615A11A22BC5A1F734') # David Schweikert <david@schweikert.ch>
source=("https://www.fping.org/dist/${pkgname}-${pkgver}.tar.gz"{,.asc}
        '0001-fix-unprivileged-ping-broken-in-v5.1-fixes-248.patch'
        '0002-fix-socket4-vs-socket6-typo-249-thanks-sfan5.patch')
sha512sums=('1a208da8dcd99093d0512af5d85ba5e7b5743ec97993d24c1fe612bb58d93090ac1ba0952f648aa075f16d390a77c4be65e394ae56dbede2a6914e0e8c68e2bd'
            'SKIP'
            'f9847470d63ba0e40fc5ce77c0689fcd858ded55ed0727308f55cbb6648b93da4bf05a35414a67054a1eb406ba8c8b29e044b6269506c8f5a70ae991e6c43152'
            'c098fc5d4e1ac7aa504cc1d92a78c05650f76d43380f0a7c719b5a717721cb327134d7fb62a6d06ba829daeda477e705b0b9f3f944742e9cf90ece5091111b96')
b2sums=('2fb344e650b5a359fb8780f2c599455d39405ae823edf695ee4385aa2661dc5811e088bafa1b9f53846ee90c0afa959a92832381a03346d1fda048eb4e7ee098'
        'SKIP'
        '593299e217cf34b6d8ddb8b8ac8ac8bc96f417f14188c78277f0afd37538b7e525d1a235129d10f14b6e16a69afde3a48e179883459b586a17c7314483de4824'
        'b3f4e4248e27b027ad07c9d1650fb93e6f672729d3bf02b1c89e3f75ecd9471a0e2b9663bc5473dcbc9ead6e10e1b4415d94599c9064762872e2116936446676')

prepare() {
  cd ${pkgname}-${pkgver}
  patch -Np1 < ../0001-fix-unprivileged-ping-broken-in-v5.1-fixes-248.patch
  patch -Np1 < ../0002-fix-socket4-vs-socket6-typo-249-thanks-sfan5.patch
}

build() {
  cd ${pkgname}-${pkgver}
  ./configure \
    --prefix=/usr \
    --sbindir=/usr/bin \
    --mandir=/usr/share/man \
    --enable-ipv4 \
    --enable-ipv6
  make
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install
  install -Dm 644 COPYING -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

# vim: ts=2 sw=2 et:
